package test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * 司机
 */
@Component
public class Driver {
    @Autowired
    @Qualifier("卡车")
    private Car car;
    public void work() {
        //选择卡车
        car.drive();
        //出去工作
        System.out.println("出去工作");
    }
}
